//
//  KLAudioTool.h
//  HealthManage
//
//  Created by 陈华 on 2017/4/9.
//  Copyright © 2017年 kinglian. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

typedef void(^VoiceMeters)(CGFloat vocieMeters);    //音量变化的回调

@interface KLAudioTool : NSObject


#pragma mark - 属性
/**录音类*/
@property(nonatomic,strong,readonly) AVAudioRecorder *audioRecorder;

#pragma mark - 单例
+ (instancetype)shareInstance;

#pragma mark - API
/**
 是否有录音权限

 @return 返回值
 */
- (BOOL)isAudioAvaiable;

/**
 开始录制音频

 @param voiceMeters 音量回调block
 @return 返回值
 */
- (BOOL)startRecord:(VoiceMeters)voiceMeters;

/**
 结束录制
 */
- (void)endRecord;

@end
